package com.sas.web.panel.clients;

import org.apache.wicket.markup.html.form.TextField;
import org.apache.wicket.markup.html.panel.Panel;

public class ClientInfoShowPanel extends Panel {

	/**
	 * 
	 */
	private static final long serialVersionUID = -5812066688343197183L;
	


	public ClientInfoShowPanel(String id) {
		super(id);
		add(new TextField<String>("cuilCuit").setRequired(true));
		add(new TextField<String>("name").setRequired(true));
		add(new TextField<String>("description").setRequired(true));
		add(new TextField<String>("email"));
		
		// address
		add(new TextField<String>("address.street"));
		add(new TextField<Integer>("address.number"));
		add(new TextField<String>("address.department"));
		add(new TextField<String>("address.city"));
		add(new TextField<String>("address.province"));
		add(new TextField<String>("address.postalCode"));
		add(new TextField<String>("address.country"));
		
		// telephone
		add(new TextField<Integer>("telephone.countryCode"));
		add(new TextField<Integer>("telephone.areaCode"));
		add(new TextField<Integer>("telephone.telephoneNumber"));
		add(new TextField<String>("telephone.intern"));
		
		// alternative tel
		add(new TextField<Integer>("alternative.countryCode"));
		add(new TextField<Integer>("alternative.areaCode"));
		add(new TextField<Integer>("alternative.telephoneNumber"));
		add(new TextField<String>("alternative.intern"));
		
		// fax
		add(new TextField<Integer>("fax.countryCode"));
		add(new TextField<Integer>("fax.areaCode"));
		add(new TextField<Integer>("fax.telephoneNumber"));
		add(new TextField<String>("fax.intern"));
		
		// cellphone
		add(new TextField<Integer>("cellphone.countryCode"));
		add(new TextField<Integer>("cellphone.areaCode"));
		add(new TextField<Integer>("cellphone.telephoneNumber"));
		add(new TextField<String>("cellphone.intern"));
	}


	public void setEnable(boolean bool) {
		get("cuilCuit").setEnabled(bool);
		get("name").setEnabled(bool);
		get("description").setEnabled(bool);
		get("email").setEnabled(bool);
		
		// address
		get("address.street").setEnabled(bool);
		get("address.number").setEnabled(bool);
		get("address.department").setEnabled(bool);
		get("address.city").setEnabled(bool);
		get("address.province").setEnabled(bool);
		get("address.postalCode").setEnabled(bool);
		get("address.country").setEnabled(bool);
		
		// telephone
		get("telephone.countryCode").setEnabled(bool);
		get("telephone.areaCode").setEnabled(bool);
		get("telephone.telephoneNumber").setEnabled(bool);
		get("telephone.intern").setEnabled(bool);
		
		// alternative tel
		get("alternative.countryCode").setEnabled(bool);
		get("alternative.areaCode").setEnabled(bool);
		get("alternative.telephoneNumber").setEnabled(bool);
		get("alternative.intern").setEnabled(bool);
		
		// fax
		get("fax.countryCode").setEnabled(bool);
		get("fax.areaCode").setEnabled(bool);
		get("fax.telephoneNumber").setEnabled(bool);
		get("fax.intern").setEnabled(bool);
		
		// cellphone
		get("cellphone.countryCode").setEnabled(bool);
		get("cellphone.areaCode").setEnabled(bool);
		get("cellphone.telephoneNumber").setEnabled(bool);
		get("cellphone.intern").setEnabled(bool);
		
	}
	
}
